import request from '@/utils/request'

// 登录方法
export function login(data) {
  return request({
    url: '/app_api/customer-login/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 手机号登录方法
export function phoneCodeLogin(query) {
  return request({
    url: '/app_api/customer-login/phone-code-login',
    headers: {
      isToken: false
    },
    method: 'get',
    params: query
  })
}

// 获取微信小程序openId
export function wxMpOpenId(query) {
  return request({
    url: `/app_api/customer/applet-get-openid/${query.code}`,
    headers: {
      isToken: false
    },
    method: 'get'
  })
}
// 微信小程序登录
export function wxMpLogin(data) {
  return request({
    url: `/app_api/customer-login/applet-weixi-login`,
    headers: {
      isToken: false
    },
    method: 'post',
		data: data
  })
}
// 绑定手机号
export function appletBindPhone(data) {
  return request({
    url: `/app_api/customer/applet-bind-phone`,
    method: 'get',
		params: data
  })
}
// 微信小程序注册
export function wxSaveInfo(data) {
  return request({
    url: `/app_api/user/saveInfo`,
    headers: {
      isToken: false
    },
    method: 'post',
		data: data
  })
}
// 注册方法
export function register(query) {
  return request({
    url: '/app_api/customer-login/register',
    headers: {
      isToken: false
    },
    method: 'get',
    params: query
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/app_api/logout',
    method: 'post'
  })
}

// 注销方法
export function cancellation() {
  return request({
    url: '/app_api/customer/cancellation',
    method: 'get'
  })
}

// 获取验证码
export function getNodeMsg(query) {
  return request({
    url: '/app_api/customer-login/get-node-msg',
    method: 'get',
		params: query
  })
}

// 账号关联
export function relationCustomer(query) {
  return request({
    url: '/app_api/customer/relation-customer',
    method: 'get',
		params: query
  })
}
// 找回密码
export function forgetPassword(query) {
  return request({
    url: '/app_api/customer-login/forget-password',
    method: 'get',
		params: query
  })
}